#include "kernel.h"
#include "screen.h"
#include "memory.h"
#include "system.h"
#include "util.h"
#include "pic.h"
#include "idt.h"

extern "C"
{

void _start(void)
{

	init_dedicated_memory();				// On initialise la RAM allouee au kernel, voir "memory.h".
	//init_idt();
	//init_pic();
	
    
    kmain();
}

}
int kmain(void)
{
	
	update_cursor(0,0);
	
	scroll(24);
	
	set_color(0x0C);
	
	
	puts("\n\n");
	
	
	puts("       .oo                           8                 .oPYo. .oPYo. \n");
	puts("      .P 8                           8                 8    8 8      \n");
	puts("     .P  8 odYo. .oPYo. oPYo. .oPYo. 8oPYo. o    o     8    8 `Yooo. \n");
	puts("    oPooo8 8' `8 .oooo8 8  `' 8    ' 8    8 8    8     8    8     `8 \n");
	puts("   .P    8 8   8 8    8 8     8    . 8    8 8    8     8    8      8 \n");
	puts("  .P     8 8   8 `YooP8 8     `YooP' 8    8 `YooP8     `YooP' `YooP' \n");
	puts("                                                 8                   \n");
	puts("                                             oooP'                   \n");
	
	set_color(0x04);
	
	puts("                                                    Now computers are free\n");
	
	set_color(0x0F);
	
	puts("\n\n\n");
	
	puts("Welcome to AnarchyOS.\n\n");
	
	char* test = (char*) malloc(6*sizeof(char));	// Testing malloc.
	test = "TEST\n\0";
	
	puts(test);
	
	puts(unsigned_itoa((unsigned int)3*1024*1024*1024));
	
    while(1)
    {

    }    

    return 0;
}
